import {
	axios
} from './http.js';
import store from '../store/index.js'
import address from './address.js'
import common from './common.js'


export const login_pub_wechat = ({
	type = "POST",
	code=''
} = {}) => {
	console.log({
			'code':code,
			'p_id':store.state.share_pid
		})
	return axios({
		path: "/api/user/user_wechat_login",
		type: type,
		data:{
			'code':code,
			'p_id':store.state.share_pid
		}
	});
};

export const login = ({
	type = "POST",
	data=''
} = {}) => {
	return axios({
		path: "/api/public/login",
		type: type,
		data:data
	});
};
export const send_sms_code = ({
	type = "POST",
	data=''
} = {}) => {
	return axios({
		path: "/api/public/sms",
		type: type,
		data:data
	});
};

export const get_user_info = ({
	type = "GET"
} = {}) => {
	return axios({
		path: "/api/user/get-info",
		type: type
	});
};





export default {
	login_pub_wechat,
	get_user_info,
	login,
	send_sms_code,
	common
}
